﻿using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace NicoView.ViewModel
{
    public class NicoViewBouyomichanPathRequestViewModel:NicoViewViewModelBase
    {

        public NicoViewBouyomichanPathRequestViewModel()
        {
            this.Path = this.InternalApplication.Instance.Property.BouyomichanPath;
            this.pathSetExecute = null;
        }

        public string Path
        {
            get;
            set;
        }


        private ICommand pathSetExecute;
        public ICommand PathSetExecute
        {
            get
            {
                if (this.pathSetExecute == null)
                {
                    this.pathSetExecute = new RelayCommand<string>((val) =>
                    {
                        this.InternalApplication.Instance.Property.BouyomichanPath = val;
                    });
                }

                return this.pathSetExecute;
            }
        }


        private ICommand openBouyomiChanHomePage;
        public ICommand OpenBouyomiChanHomePage
        {
            get
            {
                if (this.openBouyomiChanHomePage == null)
                {
                    this.openBouyomiChanHomePage = new RelayCommand(() =>
                    {
                        NicoView.Model.NicoViewApplication.Current.ExecuteUrl("http://chi.usamimi.info/Program/Application/BouyomiChan/");
                    });
                }

                return this.openBouyomiChanHomePage;
            }
        }

    }
}
